package org.abc.fund.controller.dataSource;
import lombok.RequiredArgsConstructor;
import org.abc.fund.dto.dataSource.JQAuthRequest;
import org.abc.fund.service.dataSource.JqAuthService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/auth")
@CrossOrigin(origins = "*")
public class AccountAuthController {

    private final JqAuthService jqAuthService;

    @PostMapping("/check")
    public ResponseEntity<?> checkAccount(@RequestBody JQAuthRequest request) {
        Map<String, Object> result = jqAuthService.checkAccount(
                request.getAccount(),
                request.getPassword()
        );
        return ResponseEntity.ok(result);
    }
}
